<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jstl/core"
                template="./../templates/StaffTemplate.xhtml">

    <ui:define name="nav_menu">
        <p:menu model="#{staffViewAccountManagedBean.staffMenuModel}"/>
    </ui:define>

    <ui:define name="content"> 
        <h:form>
            <f:view beforePhase="#{staffViewAccountManagedBean.initView}" >

                <p:panel id="staffDetail" header="#{bundle['staff.header.panel']}"  >
                    <p:messages id="statusMessages" />

                    <p:tabView id="tabViewStaffView" dynamic="false">

                        <p:tab id="tabStaffAccountInfo" title="#{bundle['staff.accountinfo.tab']}">
                            <h:panelGrid columns="3" cellpadding="5">
                                <h:outputLabel id="staffAccountUsernameLabel" value="#{bundle['staff.username.label']}" style="font-weight: bold"/>
                                <h:outputText id="username" value="#{staffViewAccountManagedBean.username}" />
                                <p:message for="username" />

                                <h:outputLabel id="staffAccountLanguageLabel" value="#{bundle['staff.languagepreferred.label']}" style="font-weight: bold"/>
                                <h:outputText id="language" value="#{staffViewAccountManagedBean.language}" />
                                <p:message for="language" />

                                <h:outputLabel id="staffAccountEmailLabel" value ="#{bundle['staff.email.label']}" style="font-weight: bold"/>
                                <h:outputText id="email" value="#{staffViewAccountManagedBean.email}" />
                                <p:message for="email"/>

                            </h:panelGrid>
                        </p:tab>

                        <p:tab id="tabStaffCorporateInfo" title="#{bundle['staff.corporateinfo.tab']}">
                            <h:panelGrid columns="3" cellpadding="5">

                                <h:outputLabel id="staffAccountDeptLabel" value ="#{bundle['staff.department.label']}" style="font-weight: bold"/>
                                <h:outputText id="dept" value="#{staffViewAccountManagedBean.department}" />
                                <p:message for="dept"/>

                                <h:outputLabel id="staffAccountJobPositionLabel" value ="#{bundle['staff.jobposition.label']}" style="font-weight: bold"/>
                                <h:outputText id="jobposition" value="#{staffViewAccountManagedBean.jobPosition}" />
                                <p:message for="jobposition"/>

                                <h:outputLabel id="staffAccountJoinDateLabel" value ="#{bundle['staff.joindate.label']}" style="font-weight: bold" />
                                <h:outputText id="joindate" value="#{staffViewAccountManagedBean.joinDate}" />
                                <p:message for="joindate"/>

                                <h:outputLabel id="staffAccountAccessLabel" value ="#{bundle['staff.accessrights.label']}" style="font-weight: bold" />
                                <p:dataList id="accessRights" value="#{staffViewAccountManagedBean.accessRightsList}" var="accessRight" itemType="square" >             
                                    <p:column>
                                        <h:outputText value="#{accessRight}" />
                                    </p:column>
                                </p:dataList>
                                <p:message for="accessRights"/>

                            </h:panelGrid>
                        </p:tab>

                        <p:tab id="tabStaffPersonalInfo" title="#{bundle['staff.personalinfo.tab']}">
                            <h:panelGrid  columns="3" cellpadding="5">
                                <h:outputLabel id="staffAccountNameLabel" value="#{bundle['staff.name.label']}" style="font-weight: bold"/>
                                <h:outputLabel id="name" value="#{staffViewAccountManagedBean.name}" />
                                <p:message for="username" />

                                <h:outputLabel id="staffAccountGenderLabel" value="#{bundle['staff.gender.label']}" style="font-weight: bold"/>
                                <h:outputLabel id="gender" value="#{staffViewAccountManagedBean.gender}" />
                                <p:message for="gender"/>

                                <h:outputLabel id="staffAccountBirthdateLabel" value ="#{bundle['staff.birthdate.label']}" style="font-weight: bold"/>
                                <h:outputText id="birthdate" value="#{staffViewAccountManagedBean.birthdate}" />
                                <p:message for="birthdate"/>

                                <h:outputLabel id="staffAccountCountryLabel" value ="#{bundle['staff.country.label']}" style="font-weight: bold"/>
                                <h:outputText id="country" value="#{staffViewAccountManagedBean.country}" />
                                <p:message for="country"/>

                                <h:outputLabel id="staffAccountEmailSecondaryLabel" value ="#{bundle['staff.emailSecondary.label']}" style="font-weight: bold"/>
                                <h:outputText id="emailSec" value="#{staffViewAccountManagedBean.emailSecondary}" />
                                <p:message for="emailSec"/>

                            </h:panelGrid>
                        </p:tab>

                    </p:tabView>

                    <br/>
                    <h:commandLink id="staffAccountEditButton" value="#{bundle['staff.edit.button']}" action="#{pageRedirectorBean.goEditStaffAccountPage}" />
                </p:panel>
            </f:view>
        </h:form>
    </ui:define>  
</ui:composition>

